package jkoa.middleware;

import cn.hutool.log.Log;
import cn.hutool.log.dialect.slf4j.Slf4jLog;
import jkoa.core.Context;
import jkoa.core.Next;
import jkoa.core.Request;
import jkoa.core.Response;

public class LoggingMiddleware2 {

	Slf4jLog log = new Slf4jLog(LoggingMiddleware2.class);

	public void handle(Context ctx, Next next) {
		long startTime = System.currentTimeMillis();
		next.execute(ctx);
		long endTime = System.currentTimeMillis();
		log.info("Request processed in {} ms", endTime - startTime);
	}
}